package com.smart.sso.server.switchdb;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class SessionContainer {
	private static ThreadLocal<HttpServletRequest> requestLocal = new ThreadLocal<HttpServletRequest>();

	public static HttpServletRequest getRequest() {
		return requestLocal.get();
	}

	public static void setRequest(HttpServletRequest request) {
		requestLocal.set(request);
	} 
	
	public static HttpSession getSession() {  
        return (HttpSession) ((HttpServletRequest) requestLocal.get()).getSession();
    }  
}
